package bean;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "t_class")
public class ClassBean implements Serializable {
	@Id
	private Integer classId;
	private String className;
	
	@OneToMany(fetch=FetchType.LAZY)
	@JoinColumn(name = "class_id")
	private Set<StudentBean> stuSet = new HashSet<StudentBean>();

	public ClassBean(Integer classId, String className) {
		super();
		this.classId = classId;
		this.className = className;
	}

	public ClassBean() {
		super();
	}

	public Integer getClassId() {
		return classId;
	}

	public void setClassId(Integer classId) {
		this.classId = classId;
	}

	public String getClassName() {
		return className;
	}

	public void setClassName(String className) {
		this.className = className;
	}

	public Set<StudentBean> getStuSet() {
		return stuSet;
	}

	public void setStuSet(Set<StudentBean> stuSet) {
		this.stuSet = stuSet;
	}

}
